package com.muyan.singleton.v7;

/**
 * @Author: YLTDMenglc
 * @Date: 2019/6/11
 * @Time: 13:50
 * @Description:
 */
public class EnumSingletonTest {

    public static void main(String[] args) {
        EnumSinleton7 instance1 = EnumSinleton7.INSTANCE;
        EnumSinleton7 instance2 = EnumSinleton7.INSTANCE;
        System.out.println(instance1 == instance2);
        instance1.add();
        EnumSinleton7[] values = EnumSinleton7.values();
        for (int i = 0; i < values.length; i++) {
            System.out.println(values[i]);
        }

//        Constructor<EnumSinleton7> declaredConstructor = EnumSinleton7.class.getDeclaredConstructor(String.class, int.class);
//        declaredConstructor.setAccessible(true);
//        EnumSinleton7 enumSinleton7 = declaredConstructor.newInstance();
//        System.out.println(enumSinleton7 == instance1);
//        EnumSinleton7.INSTANCE.add();
    }
}
